]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Js: Use new :icon-name property
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 21 Mar 2022 15:44:24 +0000 (16:44 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 6 May 2022 13:39:40 +0000 (13:39 +0000)
Now that we have the new convenience property, apply it to all
icon-only buttons.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2254>

14 files changed:
data/theme/gnome-shell-sass/widgets/_ibus-popup.scss
data/theme/gnome-shell-sass/widgets/_looking-glass.scss
data/theme/gnome-shell-sass/widgets/_message-list.scss
js/gdm/authPrompt.js
js/gdm/loginDialog.js
js/ui/appDisplay.js
js/ui/calendar.js
js/ui/ibusCandidatePopup.js
js/ui/lookingGlass.js
js/ui/messageList.js
js/ui/mpris.js
js/ui/screenshot.js
js/ui/unlockDialog.js
js/ui/windowPreview.js

index 28f89f33698c4501dd1494c218a768f12ac48732..8cbaa9521b39ead21c706b0e7f5a46fc27df21ec 100644 (file)
   .horizontal & { padding-left: $base_padding*2; }
 }
 
-.candidate-page-button { padding: $base_padding;}
+.candidate-page-button {
+  padding: $base_padding;
+
+  & StIcon { icon-size: $base_icon_size; }
+}
 
 .candidate-page-button-previous { border-radius: $base_border_radius 0px 0px $base_border_radius; border-right-width: 0;box-shadow: none;}
 .candidate-page-button-next { border-radius: 0px $base_border_radius $base_border_radius 0px;box-shadow: none;}
-.candidate-page-button-icon { icon-size: $base_icon_size; }
index 8639889e3ec592218ac4415c88732025ea6d1a54..146cc29c55a2124b6d6ecf1345e5f1cf8dc36e8a 100644 (file)
@@ -79,6 +79,8 @@
     color: $insensitive_fg_color;
     &:hover { color: lighten($insensitive_fg_color, 20%); }
     &:active { color: darken($insensitive_fg_color, 20%); }
+
+    & StIcon { icon-size: 12px; }
    }
 }
 
index 7f93e817d7dfdd450be041facd3928edc0953177..5196661c147e6fd1b8bfc8a35699960e7365968a 100644 (file)
     margin: 1px;
     &:hover {background-color: transparentize($fg_color, 0.8);}
     &:active {background-color: transparentize($fg_color, 0.9);}
+
+    & StIcon { icon-size: $base_icon_size; }
   }
 
   // body
   // fix margin for last button
   &:last-child:ltr { margin-right: $base_margin*3; }
   &:last-child:rtl { margin-left: $base_margin*3; }
+
+  & StIcon { icon-size: $base_icon_size; }
 }
 
 // album-art
index f9673468fa7cbb4b63228d475b3eed88e0c52548..4623c1e7c87ac69708a2f9f8a23a6a4793e09d17 100644 (file)
@@ -147,7 +147,7 @@ var AuthPrompt = GObject.registerClass({
             can_focus: this._hasCancelButton,
             x_align: Clutter.ActorAlign.START,
             y_align: Clutter.ActorAlign.CENTER,
-            child: new St.Icon({ icon_name: 'go-previous-symbolic' }),
+            icon_name: 'go-previous-symbolic',
         });
         if (this._hasCancelButton)
             this.cancelButton.connect('clicked', () => this.cancel());
index bead5c8e3e92535cb4777e3b7c8bbea8a24ef629..573a4b106013bafc8e173b64f1dad64ee5646ca2 100644 (file)
@@ -308,9 +308,9 @@ var SessionMenuButton = GObject.registerClass({
     Signals: { 'session-activated': { param_types: [GObject.TYPE_STRING] } },
 }, class SessionMenuButton extends St.Bin {
     _init() {
-        let gearIcon = new St.Icon({ icon_name: 'emblem-system-symbolic' });
         let button = new St.Button({
             style_class: 'modal-dialog-button button login-dialog-session-list-button',
+            icon_name: 'emblem-system-symbolic',
             reactive: true,
             track_hover: true,
             can_focus: true,
@@ -318,7 +318,6 @@ var SessionMenuButton = GObject.registerClass({
             accessible_role: Atk.Role.MENU,
             x_align: Clutter.ActorAlign.CENTER,
             y_align: Clutter.ActorAlign.CENTER,
-            child: gearIcon,
         });
 
         super._init({ child: button });
index dd75a09edd6e4ac8528d34db91b2ff570ebbb1b9..cf76732e96b425601e4d203000afaf9b429e54bc 100644 (file)
@@ -2665,10 +2665,7 @@ var AppFolderDialog = GObject.registerClass({
             can_focus: true,
             x_align: Clutter.ActorAlign.END,
             y_align: Clutter.ActorAlign.CENTER,
-            child: new St.Icon({
-                icon_name: 'document-edit-symbolic',
-                icon_size: 16,
-            }),
+            icon_name: 'document-edit-symbolic',
         });
 
         this._editButton.connect('notify::checked', () => {
index 5741faa81b1bd648f7c388a12c67197102974dac..f0b8c97f535b841a842775508ff2949d16512fe7 100644 (file)
@@ -469,10 +469,10 @@ var Calendar = GObject.registerClass({
 
         this._backButton = new St.Button({
             style_class: 'calendar-change-month-back pager-button',
+            icon_name: 'pan-start-symbolic',
             accessible_name: _('Previous month'),
             can_focus: true,
         });
-        this._backButton.add_actor(new St.Icon({ icon_name: 'pan-start-symbolic' }));
         this._topBox.add(this._backButton);
         this._backButton.connect('clicked', this._onPrevMonthButtonClicked.bind(this));
 
@@ -487,10 +487,10 @@ var Calendar = GObject.registerClass({
 
         this._forwardButton = new St.Button({
             style_class: 'calendar-change-month-forward pager-button',
+            icon_name: 'pan-end-symbolic',
             accessible_name: _('Next month'),
             can_focus: true,
         });
-        this._forwardButton.add_actor(new St.Icon({ icon_name: 'pan-end-symbolic' }));
         this._topBox.add(this._forwardButton);
         this._forwardButton.connect('clicked', this._onNextMonthButtonClicked.bind(this));
 
index 22bff9f9e0b2764695b29b0c6d1c2061defb5aeb..c57e289cbbfba8cd0841f4fd1e04a91421e51076 100644 (file)
@@ -59,14 +59,12 @@ var CandidateArea = GObject.registerClass({
             style_class: 'candidate-page-button candidate-page-button-previous button',
             x_expand: true,
         });
-        this._previousButton.child = new St.Icon({ style_class: 'candidate-page-button-icon' });
         this._buttonBox.add_child(this._previousButton);
 
         this._nextButton = new St.Button({
             style_class: 'candidate-page-button candidate-page-button-next button',
             x_expand: true,
         });
-        this._nextButton.child = new St.Icon({ style_class: 'candidate-page-button-icon' });
         this._buttonBox.add_child(this._nextButton);
 
         this.add(this._buttonBox);
@@ -104,14 +102,14 @@ var CandidateArea = GObject.registerClass({
             this.vertical = false;
             this.remove_style_class_name('vertical');
             this.add_style_class_name('horizontal');
-            this._previousButton.child.icon_name = 'go-previous-symbolic';
-            this._nextButton.child.icon_name = 'go-next-symbolic';
+            this._previousButton.icon_name = 'go-previous-symbolic';
+            this._nextButton.icon_name = 'go-next-symbolic';
         } else {                // VERTICAL || SYSTEM
             this.vertical = true;
             this.add_style_class_name('vertical');
             this.remove_style_class_name('horizontal');
-            this._previousButton.child.icon_name = 'go-up-symbolic';
-            this._nextButton.child.icon_name = 'go-down-symbolic';
+            this._previousButton.icon_name = 'go-up-symbolic';
+            this._nextButton.icon_name = 'go-down-symbolic';
         }
     }
 
index c7bf483e4a9d3af310c0507face09a03eedb7b09..46004f406b6fbb5ea6040e092764777a0055adbe 100644 (file)
@@ -421,8 +421,10 @@ class ObjInspector extends St.ScrollView {
             hbox.add(button);
         }
 
-        button = new St.Button({ style_class: 'window-close' });
-        button.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' }));
+        button = new St.Button({
+            style_class: 'window-close',
+            icon_name: 'window-close-symbolic',
+        });
         button.connect('clicked', this.close.bind(this));
         hbox.add(button);
         if (typeof obj == typeof {}) {
@@ -884,11 +886,7 @@ var ActorLink = GObject.registerClass({
         });
 
         const inspectButton = new St.Button({
-            child: new St.Icon({
-                icon_name: 'insert-object-symbolic',
-                icon_size: 12,
-                y_align: Clutter.ActorAlign.CENTER,
-            }),
+            icon_name: 'insert-object-symbolic',
             reactive: true,
             x_expand: true,
             x_align: Clutter.ActorAlign.START,
@@ -1304,9 +1302,7 @@ class LookingGlass extends St.BoxLayout {
         this.add_actor(toolbar);
         const inspectButton = new St.Button({
             style_class: 'lg-toolbar-button',
-            child: new St.Icon({
-                icon_name: 'find-location-symbolic',
-            }),
+            icon_name: 'find-location-symbolic',
         });
         toolbar.add_actor(inspectButton);
         inspectButton.connect('clicked', () => {
@@ -1324,9 +1320,7 @@ class LookingGlass extends St.BoxLayout {
 
         const gcButton = new St.Button({
             style_class: 'lg-toolbar-button',
-            child: new St.Icon({
-                icon_name: 'user-trash-full-symbolic',
-            }),
+            icon_name: 'user-trash-full-symbolic',
         });
         toolbar.add_actor(gcButton);
         gcButton.connect('clicked', () => {
index 99c544d017a6d5e8443153247514f923775ab4ff..f4e43f7aed0215b73cb272dbda9ee79b697e5e33 100644 (file)
@@ -362,14 +362,11 @@ var Message = GObject.registerClass({
         });
         titleBox.add_actor(this._secondaryBin);
 
-        const closeIcon = new St.Icon({
-            icon_name: 'window-close-symbolic',
-            icon_size: 16,
-        });
         this._closeButton = new St.Button({
             style_class: 'message-close-button',
-            child: closeIcon, opacity: 0,
+            icon_name: 'window-close-symbolic',
             y_align: Clutter.ActorAlign.CENTER,
+            opacity: 0,
         });
         titleBox.add_actor(this._closeButton);
 
@@ -438,10 +435,9 @@ var Message = GObject.registerClass({
     }
 
     addMediaControl(iconName, callback) {
-        let icon = new St.Icon({ icon_name: iconName, icon_size: 16 });
         const button = new St.Button({
             style_class: 'message-media-control',
-            child: icon,
+            iconName,
         });
         button.connect('clicked', callback);
         this._mediaControls.add_actor(button);
index 232e172cda8920531af31c393455be0044c2d32e..17142476983480e3c66e6f9c50d46fcc4f625df5 100644 (file)
@@ -37,7 +37,7 @@ class MediaMessage extends MessageList.Message {
                 this._player.previous();
             });
 
-        this._playPauseButton = this.addMediaControl(null,
+        this._playPauseButton = this.addMediaControl('',
             () => {
                 this._player.playPause();
             });
index 33ea6e85b8a4be2b4375b35c597ce8af61ddce98..f30884c57bc7b71ee2a0adc7333cd4966b952e3c 100644 (file)
@@ -1091,7 +1091,7 @@ var ScreenshotUI = GObject.registerClass({
 
         this._closeButton = new St.Button({
             style_class: 'screenshot-ui-close-button',
-            child: new St.Icon({ icon_name: 'preview-close-symbolic' }),
+            icon_name: 'preview-close-symbolic',
         });
         this._closeButton.add_constraint(new Clutter.BindConstraint({
             source: this._panel,
@@ -1203,19 +1203,19 @@ var ScreenshotUI = GObject.registerClass({
 
         this._shotButton = new St.Button({
             style_class: 'screenshot-ui-shot-cast-button',
+            icon_name: 'camera-photo-symbolic',
             checked: true,
         });
-        this._shotButton.set_child(new St.Icon({ icon_name: 'camera-photo-symbolic' }));
         this._shotButton.connect('notify::checked',
             this._onShotButtonToggled.bind(this));
         this._shotCastContainer.add_child(this._shotButton);
 
         this._castButton = new St.Button({
             style_class: 'screenshot-ui-shot-cast-button',
+            icon_name: 'camera-web-symbolic',
             toggle_mode: true,
             visible: Config.HAVE_RECORDER,
         });
-        this._castButton.set_child(new St.Icon({ icon_name: 'camera-web-symbolic' }));
         this._castButton.connect('notify::checked',
             this._onCastButtonToggled.bind(this));
         this._shotCastContainer.add_child(this._castButton);
@@ -1254,9 +1254,9 @@ var ScreenshotUI = GObject.registerClass({
 
         this._showPointerButton = new St.Button({
             style_class: 'screenshot-ui-show-pointer-button',
+            icon_name: 'screenshot-ui-show-pointer-symbolic',
             toggle_mode: true,
         });
-        this._showPointerButton.set_child(new St.Icon({ icon_name: 'screenshot-ui-show-pointer-symbolic' }));
         this._showPointerButtonContainer.add_child(this._showPointerButton);
 
         this.add_child(new Tooltip(this._showPointerButton, {
index dd13e312bdcbc43dbd8a4d966533bd10707c2196..bf81343b909937fa0dad512551552d8faee9a371 100644 (file)
@@ -566,7 +566,7 @@ var UnlockDialog = GObject.registerClass({
             opacity: 0,
             x_align: Clutter.ActorAlign.END,
             y_align: Clutter.ActorAlign.END,
-            child: new St.Icon({ icon_name: 'system-users-symbolic' }),
+            icon_name: 'system-users-symbolic',
         });
         this._otherUserButton.set_pivot_point(0.5, 0.5);
         this._otherUserButton.connect('clicked', this._otherUserClicked.bind(this));
index 228189b18c6f0b8e770cb30193f4ad28944e931d..e7e1ed92b3f38456ff47b71f6594261b1a25fdf4 100644 (file)
@@ -188,7 +188,7 @@ var WindowPreview = GObject.registerClass({
         this._closeButton = new St.Button({
             visible: false,
             style_class: 'window-close',
-            child: new St.Icon({ icon_name: 'preview-close-symbolic' }),
+            icon_name: 'preview-close-symbolic',
         });
         this._closeButton.add_constraint(new Clutter.BindConstraint({
             source: windowContainer,